package website.digitalocean.chapter20;

/**
 * @author: longhc@citycloud.com.cn
 * @since: 2023/2/16 14:34
 * @version: 1.0
 */
public class OrExpression implements Expression {

    private Expression expression1;
    private Expression expression2;

    public OrExpression(Expression expression1, Expression expression2) {
        this.expression1 = expression1;
        this.expression2 = expression2;
    }

    @Override
    public boolean interpret(String context) {
        return expression1.interpret(context) || expression2.interpret(context);
    }
}
